<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>周考</title>
  </head>
  <body>
    <div id="app">
      <div class="box">
        <div class="icon">PCC(<span>&#x1F525;</span>)</div>
        <div class="left">
          <div
            :class="['key', {'active': curIndex === index}]"
            v-for="(item, index) in data"
            :key="item.id"
            @mousedown="onMousedown(index)"
            @mouseup="onMouseup"
            @mouseout="onMouseup"
          >{{ item.keyTrigger }}</div>
        </div>
        <div class="right">
          <div class="power switch" @click="power = !power">
            <span>Power</span>
            <div class="button" :class="{'active': power}"></div>
          </div>

          <div class="info">{{ curIndex === -1 ? 'click mouse or key' : data[curIndex].id }}</div>

          <div class="progressBar" @click.self="onClickToPos">
            <div class="slider" @mousedown="onMousedownSlider" :style="{left: left + 'px'}"></div>
          </div>

          <div class="bank switch" @click="urlType = urlType === 'url' ? 'bankUrl' : 'url'">
            <span>Bank</span>
            <div class="button" :class="{'active': urlType === 'bankUrl'}"></div>
          </div>
        </div>
      </div>
      <audio
        :src="src"
        ref="audio"
        @canplay="$refs.audio.play()"
        muted
      ></audio>
    </div>
    <script type="module" src="/src/main.js"></script>
  </body>
</html>
